package com.wkq.util.transformer

import android.view.View
import androidx.viewpager2.widget.ViewPager2

/**
 *
 *@Author: wkq
 *
 *@Time: 2025/7/28 17:59
 *
 *@Desc: 上下翻页（VerticalFlipTransformer）
 */
class VerticalFlipTransformer : ViewPager2.PageTransformer {
    override fun transformPage(view: View, position: Float) {
        view.cameraDistance = 20000f
        view.pivotY = view.height / 2f
        view.rotationX = 180 * position
        view.alpha = if (position < -1f || position > 1f) 0f else 1f
    }
}